/**
 * content:封装window.localStorage方法，用于解决页面刷新，数据丢失问题
 * @type {Storage}
 */
const storage = window.localStorage
const localStorage = {
  setLocalStorage: function (key, values) {
    storage.setItem(key, JSON.stringify(values))
  },
  getLocalStorage: function (key) {
    return JSON.parse(storage.getItem(key))
  },
  removeLocalStorage: function (key) {
    storage.removeItem(key)
  },
  clearLocalStorage: function () {
    storage.clear()
  }
}
export default localStorage
